package ESP.Control.D;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.alibaba.fastjson.JSONArray;

import ESP.Dao.BaseDao;
import ESP.Util.IDFactory;
import ESP.VO.Survey;

public class d02 {
	@Resource
	public BaseDao baseDao;
	/**
	 * 返回信息
	 */
	private JSONArray rows;
	private Map<String, String> message = new HashMap<String, String>();
	/**
	 * 用户信息
	 */
	private String user_role_id;
	private String user_id;
	/**
	 * 问卷答案
	 */
	private String survey_id;
	private String survey1;//问题1调查
	private String survey2;//问题2调查
	private String survey3;
	private String survey4;
	private String survey5;
	private String survey6;
	private String survey7;
	private String survey8;
	private String survey9;
	/**
	 * 查询
	 */
	private String any;
	/**
	 * 增加
	 */
	public String addSurvey(){
		this.survey_id = IDFactory.getID();
		
		int i = baseDao.addSurvey(survey_id,survey1, survey2, survey3, survey4, survey5, survey6, survey7, survey8, survey9);
		if (i == 1) {
			baseDao.setReturnInfo(message, "Y", "提交成功");
		}else {
			baseDao.setReturnInfo(message, "N", "提交失败,请稍后重试!");
		}
		return "addSurvey";
	}
	/**
	 * 查询
	 */
	public String querySurvey(){
		List list = baseDao.querySurvey(any);
		this.rows = baseDao.toJson(list);
		return "querySurvey";
	}
	/**
	 * set get
	 */
	public BaseDao getBaseDao() {
		return baseDao;
	}
	public void setBaseDao(BaseDao baseDao) {
		this.baseDao = baseDao;
	}
	public JSONArray getRows() {
		return rows;
	}
	public void setRows(JSONArray rows) {
		this.rows = rows;
	}
	public Map<String, String> getMessage() {
		return message;
	}
	public void setMessage(Map<String, String> message) {
		this.message = message;
	}
	public String getUser_role_id() {
		return user_role_id;
	}
	public void setUser_role_id(String userRoleId) {
		user_role_id = userRoleId;
	}
	public String getUser_id() {
		return user_id;
	}
	public void setUser_id(String userId) {
		user_id = userId;
	}
	public String getSurvey1() {
		return survey1;
	}
	public void setSurvey1(String survey1) {
		this.survey1 = survey1;
	}
	public String getSurvey2() {
		return survey2;
	}
	public void setSurvey2(String survey2) {
		this.survey2 = survey2;
	}
	public String getSurvey3() {
		return survey3;
	}
	public void setSurvey3(String survey3) {
		this.survey3 = survey3;
	}
	public String getSurvey4() {
		return survey4;
	}
	public void setSurvey4(String survey4) {
		this.survey4 = survey4;
	}
	public String getSurvey5() {
		return survey5;
	}
	public void setSurvey5(String survey5) {
		this.survey5 = survey5;
	}
	public String getSurvey6() {
		return survey6;
	}
	public void setSurvey6(String survey6) {
		this.survey6 = survey6;
	}
	public String getSurvey7() {
		return survey7;
	}
	public void setSurvey7(String survey7) {
		this.survey7 = survey7;
	}
	public String getSurvey8() {
		return survey8;
	}
	public void setSurvey8(String survey8) {
		this.survey8 = survey8;
	}
	public String getSurvey9() {
		return survey9;
	}
	public void setSurvey9(String survey9) {
		this.survey9 = survey9;
	}
	public String getSurvey_id() {
		return survey_id;
	}
	public void setSurvey_id(String surveyId) {
		survey_id = surveyId;
	}
	public String getAny() {
		return any;
	}
	public void setAny(String any) {
		this.any = any;
	}
	
}
